{extend name="base:base" /}
{block name="seo"}
<!--/meta 作为公共模版分离出去-->
<title>文章列表 - {$app_name}</title>
{/block}
{block name="style"}
<link rel="stylesheet" href="__LIB__/zTree/v3/css/metroStyle/metroStyle.css" type="text/css">
{/block}
{block name="nav"}
<nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
    首页
    <span class="c-gray en">/</span>
    文章管理
    <span class="c-gray en">/</span>
    文章列表
</nav>
{/block}
{block name="main"}
<div class="pos-a"
     style="width:220px;left:0;top:0; bottom:0; margin-top:60px;height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5">
    <dl>
        <dt style="padding-left: 24px;line-height: 40px;background: #1890ff;color: rgba(255,255,255,1)">分类过滤</dt>
        <dd>
            <ul id="ztree" class="ztree">
            </ul>
        </dd>
    </dl>
</div>
<div style="margin-left:220px">
    <div class="panel">
        <div class="panel-body">
            <div class="clearfix">
            <span class="f-l">
                <a class="btn btn-primary radius"
                   onclick="full_add('添加文章','/{$backendPrefix}/article/add.html')"
                   href="javascript:void(0);"><i class="Hui-iconfont">&#xe600;</i> 添加文章</a>
            </span>
                <span class="f-r">共：<strong>{$count}</strong> 条数据</span>
            </div>
            <div class="mt-20 clearfix">
                <table id="data-table-list"
                       class="table table-border table-bordered table-bg table-hover table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="10%">分类</th>
                        <th width="20%">文章标题</th>
                        <th>关键词</th>
                        <th width="10%">推荐</th>
                        <th width="5%">点击数</th>
                        <th width="30%">操作</th>
                    </tr>
                    </thead>
                    <tbody class="getData-list" data-currPage='1'>
                    {notempty name="data"}
                    {volist name="data" id="vo"}
                    <tr class="text-c">
                        <td>{$vo.category_id|getCategoryNameByID}</td>
                        <td class="text-l">{$vo.title}</td>
                        <td class="text-l">{$vo.keywords}</td>
                        <td>{$vo.mark}</td>
                        <td class="f-14 td-manage">
                            {$vo.clicks}
                        </td>
                        <td class="text-l">
                            <a style="text-decoration:none" class="ml-5 btn btn-primary"
                               onClick="full_add('编辑文章','/{$backendPrefix}/article/edit/{$vo.id}.html')"
                               href="javascript:void (0);"
                               title="编辑文章"><i class="Hui-iconfont">&#xe6df;</i></a>
                        </td>
                    </tr>
                    {/volist}
                    {else /}
                    {/notempty}
                    </tbody>
                </table>
            </div>
            <div id="laypage" class="text-l"></div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__LIB__/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="__LIB__/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__ADMIN__/business/js/main.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#menu-article dd").css("display", "block");
        $("#menu-article #menu-articles").addClass("current");
    });
    var setting = {
        view: {
            dblClickExpand: false,
            showLine: false,
            selectedMulti: false
        },
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "parent_id",
                rootPId: ""
            }
        },
        callback: {
            beforeClick: function (treeId, treeNode) {
                var zTree = $.fn.zTree.getZTreeObj("tree");
                if (treeNode.isParent) {
                    zTree.expandNode(treeNode);
                    return false;
                } else {
                    demoIframe.attr("src", treeNode.file + ".html");
                    return true;
                }
            }
        }
    };
    var zNodes = {$category|raw};
    $(document).ready(function () {
        var t = $("#ztree");
        t = $.fn.zTree.init(t, setting, zNodes);
        demoIframe = $("#testIframe");
        var zTree = $.fn.zTree.getZTreeObj("tree");
        zTree.selectNode(zTree.getNodeByParam("id", '11'));
    });
</script>
{/block}